<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			h1 {
				text-align: center;
				color: burlywood;
			}
			
			#one {
				text-align: center;
				margin: 50px auto;
			}
			
			#two {
				margin-bottom: 20px;
			}
			th{
				font-family: arial;
				font-size: small;
			}
			input{
				display: block;
				margin: 10px auto;
				margin-left: 10px;
			}
			#four{
				
				text-align: center;
				display: inline-block;
				margin: 10px auto;
				color: royalblue;
			    width: 220px;
			    height:30px;
			    background-color: burlywood;
			    
			}
		</style>
	</head>

	<body>
		<h1>请注册账号</h1>
		<form action="login.html" method="get" id="one" name="register">
			<table border="0" cellspacing="0" align="center" id="two">
				<tr>
					<th align="right">用户名</th>
					<td><input type="text" name="username" placeholder="请输入用户名"> </td>
				</tr>
				<tr>
					<th align="right">手机号</th>
					<td><input type="text" name="telephone" placeholder="请输入手机号"> </td>
				</tr>
				<tr>
					<th align="right">身份证号</th>
					<td><input type="text" name="telephone" placeholder="请输入身份证号"> </td>
				</tr>
				<tr>
					<th align="right">密码</th>
					<td><input type="password" name="pwd" placeholder="请设置登录密码"> </td>
				</tr>
				<tr>
					<th align="right">确认密码</th>
					<td><input type="password" name="confirmpwd" placeholder="请确认密码"> </td>
				</tr>
				</table>
			<input type="button" value="注册" onclick="sub()" id="four"/>
		
		</form>
		<script>
			function sub(){
				var user = document.getElementsByName("username")[0].value;
				if(user.length==0 || user.length>20){
					alert("请输入正确的账号");
					return;
				}else if(document.getElementsByName("pwd")[0].value != document.getElementsByName("confirmpwd")[0].value){
				   alert("两次输入密码不一致");
				   return;
				}
				document.getElementById("one").submit();
			}
			
		</script>
	</body>

</html>